package cn.iocoder.yudao.module.warehouse.dal.mysql.warehouse;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.warehouse.dal.dataobject.warehouse.WarehouseDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.warehouse.controller.admin.warehouse.vo.*;

/**
 * 库房列表 Mapper
 *
 * @author wwwhk
 */
@Mapper
public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {

    default PageResult<WarehouseDO> selectPage(WarehousePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseDO>()
                .likeIfPresent(WarehouseDO::getWarehouseName, reqVO.getWarehouseName())
                .eqIfPresent(WarehouseDO::getType, reqVO.getType())
                .eqIfPresent(WarehouseDO::getStatus, reqVO.getStatus())
                .orderByAsc(WarehouseDO::getId));
    }

}